//package com.mini.spring.beanfactory.support;
//
//import com.mini.spring.BeansException;
//import com.mini.spring.beanfactory.factory.BeanDefinition;
//
//import java.lang.reflect.Constructor;
//
///**
// * @author: 屠一乐
// * @date: 2023/8/22 11:23
// * @description:
// */
//public class CglibSubclassingInstantiationStrategy implements InstantiationStrategy {
//
//    @Override
//    public Object instantiate(BeanDefinition beanDefinition, String beanName, Constructor ctor, Object[] args) throws BeansException {
//        Enhancer enhancer = new Enhancer();
//        enhancer.setSuperclass(beanDefinition.getBeanClass());
//        enhancer.setCallback(new NoOp() {
//            @Override
//            public int hashCode() {
//                return super.hashCode();
//            }
//        });
//        if (null == ctor) return enhancer.create();
//        return enhancer.create(ctor.getParameterTypes(), args);
//    }
//
//}